package controller

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"net/http"
	"test/common"
	"test/model"
)

func Find_allaccount(ctx *gin.Context) {
	var accounts []model.Accounts
	db := common.GetDB()
	result := db.Find(&accounts)
	fmt.Println(accounts)
	if result != nil {
		fmt.Println("dada")
	}
	ctx.JSON(http.StatusOK,accounts)
}

func Find_Money(ctx *gin.Context) {
	var accounts []model.Accounts
	db := common.GetDB()
	result := db.Find(&accounts)
	fmt.Println(accounts)
	if result != nil {
		fmt.Println("data")
	}
	ctx.JSON(http.StatusOK,accounts)
}
